﻿using ECO.Admin.Core.EntityCore;
using SqlSugar;
using System.Collections.Generic;

namespace ECO.Admin.Core.Entities.System
{
    [SugarTable("SysMenu", TableDescription = "目录菜单按钮表")]
    public class SysMenu : EntityBase<int>
    {
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 菜单父节点Id
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public int ParentId { get; set; }


        /// <summary>
        /// 节点类型
        /// </summary>
        public string NodeType { get; set; }

        /// <summary>
        /// 页面对应的地址
        /// </summary>
        public string LinkUrl { get; set; }

        /// <summary>
        /// 菜单编码
        /// </summary>
        public string Code { get; set; }


        /// <summary>
        /// 层级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 菜单备注
        /// </summary>
        public string Comments { get; set; }

        /// <summary>
        /// 菜单排序
        /// </summary>
        public int Order { get; set; }

        /// <summary>
        /// 菜单状态(正常、停用)
        /// </summary>
        public bool Status { get; set; }

        /// <summary>
        /// 菜单状态(显示、隐藏)
        /// </summary>
        public bool Visible { get; set; }


        /// <summary>
        /// 菜单图标
        /// </summary>
        public string Icon { get; set; }


        [Navigate(typeof(SysRoleMenuMapping), nameof(SysRoleMenuMapping.MenuId), nameof(SysRoleMenuMapping.RoleId))]//注意顺序
        public List<SysRole> Roles { get; set; }
    }
}
